﻿<UserControl x:Class="BizControl.Presentation.Infrastructure.Controls.CurrentUserControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:infra="clr-namespace:BizControl.Presentation.Infrastructure.Converters"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             x:Name="CurrentUserCtl">

    <UserControl.Resources>
        <infra:ImageConverter x:Key="ImageConverter" DefaultImageSource="{StaticResource defaultUserImage}" />
    </UserControl.Resources>

    <StackPanel Background="Transparent" ToolTip="{Binding Path=FullName}"
                Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Left">
        <Image Height="40" Width="40" Margin="0,0,4,0"
               Source="{Binding Converter={StaticResource ImageConverter}, Path=Photo}" />
        <Grid Width="160">
            <Grid.RowDefinitions>
                <RowDefinition />
                <RowDefinition />
            </Grid.RowDefinitions>
            <TextBlock Text="{Binding Path=FirstName}" 
                       HorizontalAlignment="Left" Margin="2"/>
            <TextBlock Grid.Row="1" Text="{Binding Path=LastName}" 
                       HorizontalAlignment="Left" Margin="2" />
        </Grid>
    </StackPanel>
</UserControl>
